Skip to content

Conversation

alexcrichton
Copy link
Member

The wasm32-wasi target delegates its malloc implementation to the
functions in wasi-libc, but the invocation of aligned_alloc was
incorrect by passing the number of bytes requested first rather than the
alignment. This commit swaps the order of these two arguments to ensure
that we allocate over-aligned memory correctly.

The wasm32-wasi target delegates its malloc implementation to the
functions in wasi-libc, but the invocation of `aligned_alloc` was
incorrect by passing the number of bytes requested first rather than the
alignment. This commit swaps the order of these two arguments to ensure
that we allocate over-aligned memory correctly.
@Mark-Simulacrum
Copy link
Member

@bors r+

Good catch!

@bors
Copy link
Collaborator

bors commented Mar 30, 2020

📌 Commit ab2998b has been approved by Mark-Simulacrum

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 30, 2020
@Mark-Simulacrum Mark-Simulacrum self-assigned this Mar 30, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 30, 2020
…r=Mark-Simulacrum

std: Fix over-aligned allocations on wasm32-wasi

The wasm32-wasi target delegates its malloc implementation to the
functions in wasi-libc, but the invocation of `aligned_alloc` was
incorrect by passing the number of bytes requested first rather than the
alignment. This commit swaps the order of these two arguments to ensure
that we allocate over-aligned memory correctly.
@bors
Copy link
Collaborator

bors commented Mar 30, 2020

⌛ Testing commit ab2998b with merge d73c6c7eac33504dae1cffc4af55de7a882b65f2...

@bors
Copy link
Collaborator

bors commented Mar 30, 2020

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 30, 2020
@Mark-Simulacrum
Copy link
Member

@bors retry - curl: (56) OpenSSL SSL_read: Connection was reset, errno 10054

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 30, 2020
@bors
Copy link
Collaborator

bors commented Mar 30, 2020

⌛ Testing commit ab2998b with merge cacdc55fb9ca5b28c68b2bd2e3e97ba96f910f9c...

@bors
Copy link
Collaborator

bors commented Mar 30, 2020

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 30, 2020
@Centril
Copy link
Contributor

Centril commented Mar 31, 2020

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 31, 2020
Centril added a commit to Centril/rust that referenced this pull request Mar 31, 2020
…r=Mark-Simulacrum

std: Fix over-aligned allocations on wasm32-wasi

The wasm32-wasi target delegates its malloc implementation to the
functions in wasi-libc, but the invocation of `aligned_alloc` was
incorrect by passing the number of bytes requested first rather than the
alignment. This commit swaps the order of these two arguments to ensure
that we allocate over-aligned memory correctly.
Centril added a commit to Centril/rust that referenced this pull request Mar 31, 2020
…r=Mark-Simulacrum

std: Fix over-aligned allocations on wasm32-wasi

The wasm32-wasi target delegates its malloc implementation to the
functions in wasi-libc, but the invocation of `aligned_alloc` was
incorrect by passing the number of bytes requested first rather than the
alignment. This commit swaps the order of these two arguments to ensure
that we allocate over-aligned memory correctly.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 31, 2020
Rollup of 9 pull requests

Successful merges:

 - rust-lang#69784 (Optimize strip_prefix and strip_suffix with str patterns)
 - rust-lang#70548 (Add long error code for error E0226)
 - rust-lang#70555 (resolve, `try_resolve_as_non_binding`: use `delay_span_bug` due to parser recovery)
 - rust-lang#70561 (remove obsolete comment)
 - rust-lang#70562 (infer array len from pattern)
 - rust-lang#70585 (std: Fix over-aligned allocations on wasm32-wasi)
 - rust-lang#70587 (Add `Rust` to the code snippet)
 - rust-lang#70588 (Fix incorrect documentation for `str::{split_at, split_at_mut}`)
 - rust-lang#70613 (more clippy fixes)

Failed merges:

r? @ghost
@bors bors merged commit cd4d1c7 into rust-lang:master Mar 31, 2020
@alexcrichton alexcrichton deleted the fix-wasi-align-alloc branch July 23, 2020 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants